.PHONY: all
.PHONY: debug
.PHONY: linux
.PHONY: clean

GPP=g++
OUT=../../release/humansoul.exe
FOLDERS := *.ext core/*.ext math/*.ext
SOURCES := $(wildcard $(FOLDERS:%.ext=%.cpp))
HEADERS := $(wildcard $(FOLDERS:%.ext=%.h))
OBJ := $(SOURCES:%.cpp=%.o)
LINK := -lm
PARAMS := -static-libgcc -std=c++0x

all: debug;

$(OUT): $(OBJ)
	$(GPP) -Wall $(PARAMS) $(LINK) $(OBJ) -o $(OUT)

debug: $(OUT);

linux: ../../release/humansoul;

../../release/humansoul: $(OBJ)
	$(GPP) -Wall $(PARAMS) $(LINK) $(OBJ) -o ../../release/humansoul 

%.o: %.cpp $(HEADERS)
	$(GPP) -c -Wall $(PARAMS) $(@:%.o=%.cpp) -o $@

clean:
	del $(OBJ)
